package per.johnson.thread;

/**
 * Created by Johnson on 2018/9/23.
 */
public class RunThreadTest {
    public static void main(String[] args) {
        Thread t1 = new Thread(new MyRunnable(1));
        Thread t2 = new Thread(new MyRunnable(2));
        Thread t3 = new Thread(new MyRunnable(3));
        Thread t4 = new Thread(new MyRunnable(4));
        Thread t5 = new Thread(new MyRunnable(5));
        t1.start();
        t2.start();
        t3.start();
        t4.start();
        t5.start();
    }

}
class MyRunnable implements Runnable{
    private int index;
    public MyRunnable(int index){
        this.index = index;
    }
    @Override
    public void run() {
        System.out.println("My index is " + index);
    }
}
